The semantic marriage of monads and effects
نویسندگان
چکیده
Wadler and Thiemann unified type-and-effect systems with monadic semantics via a syntactic correspondence and soundness results with respect to an operational semantics. They conjecture that a general, “coherent” denotational semantics can be given to unify effect systems with a monadic-style semantics. We provide such a semantics based on the novel structure of an indexed monad, which we introduce. We redefine the semantics of Moggi’s computational λ-calculus in terms of (strong) indexed monads which gives a oneto-one correspondence between indices of the denotations and the effect annotations of traditional effect systems. Dually, this approach yields indexed comonads which gives a unified semantics and effect system to contextual notions of effect (called coeffects), which we have previously described [9]. Previously, Wadler and Thiemann established a syntactic correspondence between type-and-effect systems and the monadic semantics approach by annotating monadic type constructors with the effect sets of the type-and-effect system [10]. They established soundness results between the effect system and an operational semantics, and conjectured a “coherent semantics” of effects and monads in a denotational style. One suggestion was to associate to each effect set σ a different monad T . We take a different approach to a coherent semantics, unifying effect systems with a monadic-style semantics in terms of the novel notion of indexed monads, which generalises monads. Indexed monads Indexed monads comprise a functor
منابع مشابه
ar X iv : 1 40 1 . 53 91 v 1 [ cs . P L ] 2 1 Ja n 20 14 The semantic marriage of monads and effects Extended abstract Dominic Orchard
Wadler and Thiemann unified type-and-effect systems with monadic semantics via a syntactic correspondence and soundness results with respect to an operational semantics. They conjecture that a general, “coherent” denotational semantics can be given to unify effect systems with a monadic-style semantics. We provide such a semantics based on the novel structure of an indexed monad, which we intro...
متن کاملRemarrying Effects and Monads
Sixteen years ago Wadler and Thiemann published “The marriage of effects and monads” [35] where they united two previously distinct lines of research: the effect typing discipline (proposed by Gifford and others [11, 31]) and monads (proposed by Moggi and others [23, 34]). In this paper, we marry effects and monads again but this time within a single programming paradigm: we use monads to defin...
متن کاملLeibniz’s Monads and Mulla Sadra’s Hierarchy of Being: A Comparative Study
Mulla Sadra and Leibniz, the two philosophers from the East and the West, belong to two different worlds. Though they were unaware of the ideas of each other, their philosophical systems share certain common points that are comparable. Monads constitute the basis of Leibniz's thought and he refers to their features in his various works. On the other side, Mulla Sadra's philosophy is also based ...
متن کاملMonads and Effects
A tension in language design has been between simple semantics on the one hand, and rich possibilities for side-effects, exception handling and so on on the other. The introduction of monads has made a large step towards reconciling these alternatives. First proposed by Moggi as a way of structuring semantic descriptions, they were adopted by Wadler to structure Haskell programs. Monads have be...
متن کاملComplete Elgot Monads and Coalgebraic Resumptions
Monads are extensively used nowadays to abstractly model a wide range of computational effects such as nondeterminism, statefulness, and exceptions. It turns out that equipping a monad with a (uniform) iteration operator satisfying a set of natural axioms allows for modelling iterative computations just as abstractly. The emerging monads are called complete Elgot monads. It has been shown recen...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
- CoRR
دوره abs/1401.5391 شماره
صفحات -
تاریخ انتشار 2014